import request from '@/utils/request'

/**
 * 查询今日数据
 * @param {*} today 
 * @returns 
 */
export const getTodayInfoService = (today) => {
    return request.get('/admin/console/today/info', {
        params: {
            today
        }
    })
}

/**
 * 评论留言数据
 * @param {*} today 
 * @returns 
 */
export const getCommentInfoService = () => {
    return request.get('/admin/console/wait')
}

/**
 * 发布全站通知
 * @param {*} message 
 * @param {*} expirationTime 
 * @returns 
 */
export const notifyService = (message,expirationTime) => {
    return request.post('/admin/notify', {
        message,
        expirationTime
    })
}

/**
 * 获取欢迎词
 * @returns 
 */
export const getMyWelcomeInfoService = () => {
    return request.get('/admin/console/welcome')
}

/**
 * 新增或者修改欢迎词
 * @param {*} content 
 * @returns 
 */
export const addOrUpdateWelcomeService = (content) => {
    return request.post('/admin/console/add/welcome', content)
}

/**
 * 网站实时在线人数显示
 */
export const getOnlineUserService = () => {
    return request.get("/admin/console/online/user")
}
